<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <link rel="shortcut icon" href="../favicon.ico" />
    
    <title>Document</title>
  </head>

  <body>
    <!-- 引入顺序必须按照先引入核心库的顺序，否则报错  -->
    <div id="root"></div>

    <script src="../js/react.development.js"></script>

    <!-- <script src="../js/prop-types.js"></script> 目前没什么用 -->
    <script src="../js/react-dom.development.js"></script>
    <script src="../js/babel.min.js"></script>

    <script type="text/babel">
    // 创建函数式组件
    function Demo() {
        return <h1>I am fun()</h1>
    };
    // 渲染组件到页面
    ReactDOM.render(<Demo/>,document.getElementById('root'))
    // 执行上面后先解析组件标签
    // 组件函数定义，调用该函数，将虚拟DOM转为真实DOM
    
    getBat.onclick = ()=> {
      alert('Now you see me!')
    }
    
    </script>
  </body>
</html>
